home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Apple WWDC 1996
/
WWDC96_1996 (CD).toast
/
Technology Materials
/
MacOS 8 Resources
/
Developer Tools
/
Mac OS 8 Interfaces & Libraries
/
Interfaces
/
AIncludes
/
DeskBus.a
< prev
next >
Wrap
Text File
|
1996-05-01
|
4KB
|
148 lines
;
; File: DeskBus.a
;
; Contains: Apple Desktop Bus (ADB) Interfaces.
;
; Version: Technology: System 7.5
; Release: Universal Interfaces 3.0d3 on Copland DR1
;
; Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
;
; Bugs?: If you find a problem with this file, send the file and version
; information (from above) and the problem description to:
;
; Internet: apple.bugs@applelink.apple.com
; AppleLink: APPLE.BUGS
;
;
IF &TYPE('__DESKBUS__') = 'UNDEFINED' THEN
__DESKBUS__ SET 1
IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
include 'Types.a'
ENDIF
IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
include 'MixedMode.a'
ENDIF
IF FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE THEN
; typedef SInt8 ADBAddress
ADBDataBlock RECORD 0
devType ds.b 1 ; offset: $0 (0) ; original handler ID
origADBAddr ds.b 1 ; offset: $1 (1) ; original ADB Address
dbServiceRtPtr ds.l 1 ; offset: $2 (2) ; service routine pointer
dbDataAreaAddr ds.l 1 ; offset: $6 (6) ; this field is passed as the refCon parameter to the service routine
sizeof EQU * ; size: $A (10)
ENDR
; typedef struct ADBDataBlock * ADBDBlkPtr
ADBSetInfoBlock RECORD 0
siService ds.l 1 ; offset: $0 (0) ; service routine pointer
siDataAreaAddr ds.l 1 ; offset: $4 (4) ; this field is passed as the refCon parameter to the service routine
sizeof EQU * ; size: $8 (8)
ENDR
; typedef struct ADBSetInfoBlock * ADBSInfoPtr
; ADBOpBlock is only used when calling ADBOp from 68k assembly code
ADBOpBlock RECORD 0
dataBuffPtr ds.l 1 ; offset: $0 (0) ; buffer: pointer to variable length data buffer
opServiceRtPtr ds.l 1 ; offset: $4 (4) ; completionProc: completion routine pointer
opDataAreaPtr ds.l 1 ; offset: $8 (8) ; refCon: this field is passed as the refCon parameter to the completion routine
sizeof EQU * ; size: $C (12)
ENDR
; typedef struct ADBOpBlock * ADBOpBPtr
;
; pascal void ADBReInit(void )
;
IF ¨ GENERATINGCFM THEN
_ADBReInit: OPWORD $A07B
ELSE
IMPORT_CFM_FUNCTION ADBReInit
ENDIF
;
; ADBOp has a different interface for 68k assembly than for everything else
; for 68k assembly the interface is
; #pragma parameter __D0 ADBOp(__A0,__D0)
; OSErr ADBOp( ADBOpBlock * pb, short commandNum );
;
;
; IMPORTANT NOTE:
; "Inside Macintosh: Devices" documents the completion routine for ADBOp will be called with
; four parameters using 68k register based calling conventions, specifically the completion routine
; passed in should be of type ADBServiceRoutineProcPtr. However, when upp types were first added
; to this interface file, the type ADBCompletionUPP was mistakenly used for the second parameter
; to ADBOp. Since applications have shipped using completion routines of type ADBCompletionUPP,
; the mistake cannot be corrected.
; The only difference between ADBServiceRoutineUPP and ADBCompletionUPP is the former takes an extra
; argument which is a pointer to itself, fortunately not needed for PowerPC code.
; For compatibility with existing 68k code, when an ADBOp completion routine is called,
; 68k register A1 will point to the completion routine, as documented in Inside Mac.
;
;
; pascal OSErr ADBOp(Ptr refCon, ADBCompletionUPP compRout, Ptr buffer, short commandNum)
;
IF ¨ GENERATINGCFM THEN
_ADBOp: OPWORD $A07C
ELSE
IMPORT_CFM_FUNCTION ADBOp
ENDIF
;
; pascal short CountADBs(void )
;
IF ¨ GENERATINGCFM THEN
; returns:
; short <= D0
_CountADBs: OPWORD $A077
ELSE
IMPORT_CFM_FUNCTION CountADBs
ENDIF
;
; pascal ADBAddress GetIndADB(ADBDataBlock *info, short devTableIndex)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; info => A0
; devTableIndex => D0
; returns:
; ADBAddress <= D0
_GetIndADB: OPWORD $A078
ELSE
IMPORT_CFM_FUNCTION GetIndADB
ENDIF
;
; pascal OSErr GetADBInfo(ADBDataBlock *info, ADBAddress adbAddr)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; info => A0
; adbAddr => D0
; returns:
; OSErr <= D0
_GetADBInfo: OPWORD $A079
ELSE
IMPORT_CFM_FUNCTION GetADBInfo
ENDIF
;
; pascal OSErr SetADBInfo(const ADBSetInfoBlock *info, ADBAddress adbAddr)
;
IF ¨ GENERATINGCFM THEN
; parameters:
; info => A0
; adbAddr => D0
; returns:
; OSErr <= D0
_SetADBInfo: OPWORD $A07A
ELSE
IMPORT_CFM_FUNCTION SetADBInfo
ENDIF
ENDIF
ENDIF ; __DESKBUS__